package com.wzh.glsc.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author xiaoming
 * @PackageName:com.wzh.glsc.auth.vo
 * @ClassName:@{NAME}
 * @Description:
 * @date:@{DATE}@{TIME}
 */
@Data
public class UserRegistVo {

    //必须提交用户名
    @NotBlank(message = "用户名不能为空")
    private String userName;
    //必须提交密码
    //必须大于等于8位
    @NotBlank(message = "密码不能为空")
    @Length(min = 6,max=18,message = "密码必须在6~18之间位")
    private String password;
    //必须是符合手机号
    @NotBlank(message = "手机号不能为空")
    @Length(min = 11,max=11,message = "手机号长度必须是11位")
    @Pattern(regexp="^1(3|4|5|7|8)\\d{9}$",message="手机号码格式错误！")
    private String phone;
    //必须是6位数字
    @NotBlank(message = "验证码不能为空")
    @Length(min = 6,max=6,message = "验证码必须是6位")
    private String code;
}
